eventcontrollerscroll: Fix the history push condition
authorAlexander Mikhaylenko <alexm@gnome.org>
Thu, 14 May 2020 20:20:38 +0000 (01:20 +0500)
committerAlexander Mikhaylenko <alexm@gnome.org>
Thu, 14 May 2020 20:32:04 +0000 (01:32 +0500)
commit5dc6194b98792d937c648835cfadbe64977db443
tree51ba8dd729ebbfb1c2c19c06a4f71729f71c20bc
parentc025a569a9e94a721bb52d0595575040e1ca30bc
eventcontrollerscroll: Fix the history push condition

Once upon a time, there was a function called gdk_event_get_scroll_deltas().
It returned %TRUE when an event had scroll deltas and that was used as the
condition to decide whether to push scroll deltas to the scroll history,
even when the both deltas are 0 for the stop event at the end of scrolling.

When GtkScrolledWindow kinetic scrolling code was adapted for
GtkEventControllerScroll, it was replaced with a (dx != 0 && dy != 0)
check. This prevented the stop event from getting into the history, and
instead allowed non-smooth scrolling to affect the history as they have
synthetic deltas with one of the values being -1 or 1 and the other on 0.

Instead, check the direction as we already have it as a local variable.
gtk/gtkeventcontrollerscroll.c